package com.telit.uav.feign;

import com.telit.common.dto.SysUserRolePageDto;
import com.telit.common.vo.user.Result;
import com.telit.common.vo.user.SysUserInfoVo;
import com.telit.common.vo.user.SysUserShortVo;
import com.telit.uav.feign.fallBack.UpmsFeignClientFallBack;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;


/**
 * @Auther amy
 * @Describe 统一平台feign调用
 */
@FeignClient(name = "pt-upms",fallback = UpmsFeignClientFallBack.class)
public interface UpmsFeignClient {

    /**
     * 查询用户详情
     * @param ids
     * @return
     */
    @ApiOperation(value = "依据多个用户id查询用户所属单位、部门等主要信息列表")
    @GetMapping("/user/queryUserListByIds/{ids}")
    Result<List<SysUserShortVo>> queryUserListByIds(@PathVariable("ids") List<Long> ids);

    @GetMapping(value = {"/user/{id}"})
    Result getUserDetail(@PathVariable(value = "id", required = false) Long id);

    @ApiOperation(value = "依据角色及组合条件查询全部用户列表结果")
    @GetMapping("/user/getListForRole")
    Result<List<SysUserShortVo>> getListForRole(@SpringQueryMap SysUserRolePageDto sysUserRolePageDto);


//    @GetMapping("/user/queryUserInfoByIds/{ids}")
    @PostMapping("/user/queryUserInfoByIds")
    Result<List<SysUserInfoVo>> queryUserInfoByIds2(@RequestBody List<Long> ids);
}
